aboutsummaryrefslogtreecommitdiff
path: root/packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro')
-rw-r--r--packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro b/packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro
new file mode 100644
index 000000000..893cbb9c6
--- /dev/null
+++ b/packages/astro/test/fixtures/legacy-content-collections/src/pages/with-scripts/[...slug].astro
@@ -0,0 +1,21 @@
+---
+import { getCollection } from 'astro:content';
+
+export async function getStaticPaths() {
+ const blogEntries = await getCollection('with-scripts');
+ return blogEntries.map(entry => ({
+ params: { slug: entry.slug }, props: { entry },
+ }));
+}
+
+const { entry } = Astro.props;
+
+const { Content } = await entry.render();
+const { title } = entry.data;
+---
+
+<article>
+ <h1>This is a content collection post</h1>
+ <h2>{title}</h2>
+ <Content />
+</article>